package com.tang.model.composite.transparent;

/**
 * @Author tangyuan2meicloud.com
 * @DATE 2021/8/22 21:43
 * @Desc 组合模式的透明写法
 * @Remarks
 */
public class TransparentTest {
    public static void main(String[] args) {
        CourseCompnent coursePackage = new CoursePackage("java架构师课程", 2);
        CourseCompnent course = new Course("Java基础", 3000);
        CourseCompnent source = new Course("源码分析", 3000);
        CourseCompnent soft = new Course("软件技巧", 3000);
        coursePackage.addChild(source);
        coursePackage.addChild(course);
        coursePackage.addChild(soft);
        CourseCompnent ai = new Course("AI", 3000);
        CourseCompnent bigdata = new Course("大数据", 3000);
        CourseCompnent gupao = new CoursePackage("gupao", 1);
        gupao.addChild(coursePackage);
        gupao.addChild(ai);
        gupao.addChild(bigdata);
        gupao.print();
    }
}
